package homework.homework01;

public class Manager extends People {
    /* private String name;
     private String workId;
     private double salary;*/
    private double bonus;

    public Manager() {
    }

    public Manager(double bonus) {
        this.bonus = bonus;
    }

    public Manager(String name, String workId, double salary, double bonus) {
        super(name, workId, salary);
        this.bonus = bonus;
    }
    //合理暴露

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }

    //重写work方法
    //注意事项,权限必须大于等于父类,返回值类型必须小于父类
    @Override
    public void work() {
        System.out.println("工号为" + getWorkId() + "的" + getName() + "项目经理" +
                "拿着" + getSalary() + "工资和" + getBonus() + "的奖金,正在盯着程序员写代码");
    }

    @Override
    public String toString() {
        return "Manager{" +super.toString()+
                "bonus=" + bonus +
                '}';
    }
}
